<template>
  <el-row class="mb15">
    <el-col :span="7">
      <el-input v-model="obj.keyword" placeholder="搜索关键字" />
    </el-col>
    <slot></slot>
    <el-col :span="7" :offset="1">
      <el-button type="success" @click="startSearch">搜索</el-button>
      <el-button type="danger" @click="resetData">重置</el-button>
    </el-col>
  </el-row>
</template>

<script lang="ts" setup>
import { ref } from "vue";
const obj = ref<any>({});
const $emit = defineEmits(["todochange"]); //自定义事件实现子改父
const startSearch = () => {
  $emit("todochange", obj.value);
};
const resetData = () => {
  obj.value = {};
};
defineExpose({
  obj,
});
</script>
